import "package:ct_pa_majordomo/pages/device/lock/add_lock/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/detail/index.dart" as lock;
import "package:ct_pa_majordomo/pages/device/lock/electronic_key/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/electronic_key/widgets/expiration_date/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/electronic_key/widgets/ope_record/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/electronic_key/widgets/send_key/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/electronic_key/widgets/detail/index.dart" as electronic_key;
import "package:ct_pa_majordomo/pages/device/lock/fingerprint/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/fingerprint/widgets/add_fingerprint/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/fingerprint/widgets/add_fingerprint_operation/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/fingerprint/widgets/add_fingerprint_tip/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/fingerprint/widgets/detail/index.dart" as fingerprint_key;
import "package:ct_pa_majordomo/pages/device/lock/ic_card/add_ic_card.dart";
import "package:ct_pa_majordomo/pages/device/lock/ic_card/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/ic_card/widgets/add_card/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/ic_card/widgets/detail/index.dart" as ic_card;
import "package:ct_pa_majordomo/pages/device/lock/ic_card/widgets/ope_record/index.dart" as ic_card_ope;
import "package:ct_pa_majordomo/pages/device/lock/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/lock_result/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/lock_wifi/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/near_lock/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/password_key/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/password_key/widgets/detail/index.dart" as password_key;
import "package:ct_pa_majordomo/pages/device/lock/password_key/widgets/get_key/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/password_key/widgets/ope_record/index.dart" as password_key_ope;
import "package:ct_pa_majordomo/pages/device/lock/setting/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/base/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/bound_gateways/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/electricity/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/lock_sound/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/pwd_manage/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/setting/widgets/auto_lock/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/widgets/operation_record/index.dart";
import "package:ct_pa_majordomo/router/keys.dart";
import "package:flutter/cupertino.dart";
import "package:ct_pa_majordomo/pages/device/widgets/select_wifi.dart";

class LockRoutes {
  static Map<String, WidgetBuilder> getRoutes(BuildContext context) {
    return {
      ///门锁
      Keys.DEVICE_LOCK: (context) => const Lock(),
      ///门锁 详情
      Keys.DEVICE_LOCK_DETAIL: (context, {arguments}) => lock.Detail(lockInfo: arguments,),
      ///门锁 添加门锁
      Keys.DEVICE_LOCK_ADD: (context) => const AddLock(),
      ///门锁 附近的锁
      Keys.DEVICE_LOCK_NEAR_LOCK: (context, {arguments}) => NearLock(lockName: arguments),
      ///门锁 门锁添加结果
      Keys.DEVICE_LOCK_ADD_LOCK_RESULT: (context, {arguments}) => LockResult(lockInfo: arguments),
      ///门锁 配置wifi
      Keys.DEVICE_LOCK_WIFI: (context, {arguments}) => LockWifi(lockData: arguments["lockData"], lockId: arguments["lockId"], type: arguments["type"], wifi: arguments?["wifi"],),

      ///门锁 操作记录
      Keys.DEVICE_LOCK_OPERATION: (context, {arguments}) => OperationRecord(lockId: arguments["lockId"], lockData: arguments["lockData"],),

      ///门锁 IC卡列表
      Keys.DEVICE_LOCK_IC_CARD: (context, {arguments}) => IcCard(info: arguments, ),
      ///门锁 添加IC卡
      Keys.DEVICE_LOCK_IC_CARD_ADD: (context, {arguments}) => AddCard(lockInfo: arguments, ),
      /// 门锁 IC卡 详情
      Keys.DEVICE_LOCK_IC_CARD_DETAIL: (context, {arguments}) => ic_card.Detail(info: arguments, ),
      /// 门锁 IC卡 操作记录
      Keys.DEVICE_LOCK_IC_CARD_OPE_RECORD: (context, {arguments}) => ic_card_ope.OpeRecord(info: arguments, ),
      ///门锁 添加IC卡
      // Keys.DEVICE_LOCK_ADD_IC_CARD: (context, {arguments}) => AddICCard(
      //   renter: arguments['renter'],
      //   lockId: arguments['lockId'],
      // ),

      ///门锁 指纹
      Keys.DEVICE_LOCK_FINGERPRINT: (context, {arguments}) => Fingerprint(info: arguments),
      ///门锁 添加指纹
      Keys.DEVICE_LOCK_FINGERPRINT_ADD: (context, {arguments}) => AddFingerprint(info: arguments),
      ///门锁 添加指纹引导页
      Keys.DEVICE_LOCK_FINGERPRINT_ADD_TIP: (context, {arguments}) => AddFingerprintTip(info: arguments["info"], params: arguments["params"],),
      ///门锁 添加指纹操作页
      Keys.DEVICE_LOCK_FINGERPRINT_ADD_OPERATION: (context, {arguments}) => AddFingerprintOperation(info: arguments["info"], params: arguments["params"],),
      ///门锁 指纹详情页
      Keys.DEVICE_LOCK_FINGERPRINT_DETAIL: (context, {arguments}) => fingerprint_key.Detail(info: arguments,),


      ///门锁 电子钥匙
      Keys.DEVICE_LOCK_ELECTRONICKEY: (context, {arguments}) => ElectronicKey(lockId: arguments,),
      ///门锁 电子钥匙 发送钥匙
      Keys.DEVICE_LOCK_ELECTRONICKEY_SEND_KEY: (context, {arguments}) => SendKey(lockId: arguments,),
      ///门锁 电子钥匙 详情
      Keys.DEVICE_LOCK_ELECTRONICKEY_DETAIL: (context, {arguments}) => electronic_key.Detail(lockInfo: arguments),
      ///门锁 电子钥匙 修改有效期
      Keys.DEVICE_LOCK_ELECTRONICKEY_EXPIRATION_DATE: (context) => const ExpirationDate(),
      ///门锁 电子钥匙 操作记录
      Keys.DEVICE_LOCK_ELECTRONICKEY_OPE_RECORD: (context, {arguments}) => OpeRecord(info: arguments),


      ///门锁 密码
      Keys.DEVICE_LOCK_PASSWORDKEY: (context, {arguments}) => PasswordKey(lockInfo: arguments,),
      ///门锁 密码 详情
      Keys.DEVICE_LOCK_PASSWORDKEY_DETAIL: (context, {arguments}) => password_key.Detail(info: arguments),
      ///门锁 密码 获取密码
      Keys.DEVICE_LOCK_PASSWORDKEY_GETKEY: (context, {arguments}) => GetKey(lockInfo: arguments,),
      ///门锁 密码 操作记录
      Keys.DEVICE_LOCK_PASSWORDKEY_OPE_RECORD: (context, {arguments}) => password_key_ope.OpeRecord(info: arguments),


      ///门锁 设置
      Keys.DEVICE_LOCK_SETTING: (context, {arguments}) => Setting(info: arguments,),
      ///门锁 设置 基础信息
      Keys.DEVICE_LOCK_SETTING_BASE: (context, {arguments}) => Base(info: arguments,),
      ///门锁 设置 基础信息 管理员开锁密码
      Keys.DEVICE_LOCK_SETTING_ADMIN_PASSWORD: (context, {arguments}) => PwdManage(info: arguments,),
      ///门锁 设置 基础信息 电量
      Keys.DEVICE_LOCK_SETTING_POWER: (context, {arguments}) => Electricity(info: arguments,),
      ///门锁 设置 网关
      Keys.DEVICE_LOCK_SETTING_BOUND_GATEWAY: (context, {arguments}) => BoundGateways(lockId: arguments),
      ///门锁 设置 锁声音
      Keys.DEVICE_LOCK_SETTING_SOUND: (context, {arguments}) => LockSound(info: arguments),
      ///门锁 设置 自动闭锁
      Keys.DEVICE_LOCK_SETTING_AUTO_LOCK: (context, {arguments}) => AutoLock(info: arguments),

      ///设备 选择WiFi
      Keys.DEVICE_SELECT_WIFI: (context, {arguments}) {
        final args = arguments as Map<String, dynamic>;
        final type = args['type'] as ConfigWifiType;
        final deviceData = args['deviceData'] as String?;
        return SelectWifi(type: type, deviceData: deviceData);
      },
    };
  }
}